﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TienTeTuong.back_end
{
    public partial class AddSponsor : System.Web.UI.Page
    {
        public Guid id = Guid.NewGuid();
        public SponsorDTO item = new SponsorDTO();
        public SponsorBUS cateBus = new SponsorBUS();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Admin"] == null)
            {
                Response.Redirect("Default.aspx");
            }

            if (Page.IsPostBack)
            {

                item.ID = id.ToString();
                item.FullName = txtFullName.Text;
                item.Email = txtEmail.Text;
                item.Address = txtAddress.Text;
                item.Phone = txtPhone.Text;
                item.Description = txtDescription.Text;
                item.Viplevel = int.Parse(txtVipLevel.Text);
                item.Money = TxtMoney.Text;
                item.Active = isActive.Value == "1";
                cateBus.add(item);
                Response.Redirect("Sponsermanagement.aspx");
            }
        }
    }
}